﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WorkOrder.Models;

/// <summary>
/// 工单操作日志表
/// </summary>
[Table("工单操作日志表")]
[Index("工单id", Name = "fk_操作_工单")]
[Index("操作人id", Name = "fk_操作_用户")]
[Index("操作类型", Name = "idx_操作类型")]
public partial class 工单操作日志表
{
    /// <summary>
    /// 操作ID
    /// </summary>
    [Key]
    [Column("操作ID")]
    public long 操作id { get; set; }

    /// <summary>
    /// 工单ID
    /// </summary>
    [Column("工单ID")]
    public string 工单id { get; set; }

    /// <summary>
    /// 操作人
    /// </summary>
    [Column("操作人ID")]
    public string 操作人id { get; set; }

    /// <summary>
    /// 操作类型
    /// </summary>
    public OperationType 操作类型 { get; set; }  // 直接使用枚举类型

    /// <summary>
    /// 操作详情
    /// </summary>
 
    public string? 操作详情 { get; set; }

    /// <summary>
    /// 操作时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime 操作时间 { get; set; }

    [ForeignKey("工单id")]
    [InverseProperty("工单操作日志表s")]
    public virtual 工单主表 工单 { get; set; } = null!;
}
